const RolesModel = require("../model/RolesModel")

const RolesService = {
    getList:async () => {
        return await RolesModel.find()
    },
    updateList:async (id,{roleName,rights}) => {
        return await RolesModel.findByIdAndUpdate(id,{
            roleName,
            rights
        })
    },
    delete:async (id) => {
        return await RolesModel.findByIdAndDelete(id)
    }
}
module.exports = RolesService